<!DOCTYPE html>
<html>

<head>
  <meta charset="utf-8">
  <title>管理员页面</title>
  <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />

  <link rel="stylesheet" type="text/css" href="/static/rootcss/page.css" />
  <link href="/static/rootcss/icons.min.css" rel="stylesheet" type="text/css" />
  <link rel="stylesheet" href="https://lib.sinaapp.com/js/bootstrap/4.2.1/css/bootstrap.min.css">
</head>

<body>
  <div class="page" id="app">
    <div class="nav-left">
      <div class="LogoName">
        Heaven's Cloud
      </div>
      <div class="navDiv">
        <div class="navName">导航</div>
        <div class="nav-list">
          <ul>
            <li class="nav-tab a_active waves-effect">
              <a href="/rootHome" class="li-a active" target="iframe"><i class='bx bx-home-smile'></i> 主页
                <i class='bx bx-chevron-right' style="float: right;"></i>
                <!-- <span class="badge badge-pill badge-primary float-right">3</span> -->
              </a>
            </li>
            <!-- <li class="nav-tab">
						<a href="#" class="li-a"><i class='bx bx-home-smile'></i> 设备管理</a>
					</li> -->
            <li class="nav-tab nav-ul">
              <a href="javascript:void[0]" class="li-a"><i class='bx bx-layer'></i> 用户管理
                <i class='bx bx-chevron-right' style="float: right;"></i></a>
              <div class="nav-box">
                <a href="/root/userpage" class="li-a-a" target="iframe">所有用户</a>
              </div>
            </li>
            <li class="nav-tab nav-ul">
              <a href="javascript:void[0]" class="li-a"><i class='bx bx-cog'></i> 问卷管理
                <i class='bx bx-chevron-right' style="float: right;"></i></a>
              <div class="nav-box">
                <a href="/root/unpublish" class="li-a-a" target="iframe">未发布问卷</a>
                <a href="/root/publish" class="li-a-a" target="iframe">已发布问卷</a>
              </div>
            </li>
            <li class="nav-tab nav-ul">
              <a href="javascript:void[0]" class="li-a"><i class='bx bx-buildings'></i> 设置
                <i class='bx bx-chevron-right' style="float: right;"></i></a>
              <div class="nav-box">
                <a href="/root/updatePwd" class="li-a-a" target="iframe">修改密码</a>
                <a class="li-a-a" onclick="logout()">退出</a>
              </div>
            </li>
          </ul>
        </div>
      </div>
    </div>
    <div class="nav-right">
      <div class="nav-top">
        上方导航
      </div>
      <div class="content-page">
        <iframe name="iframe" width="100%" height="100%" frameborder="0" src="/rootHome"></iframe>
      </div>
    </div>
  </div>

  <script type="text/javascript" src="/static/js/jquery-3.6.0.min.js"></script>
  <script src="https://cdn.bootcss.com/axios/0.18.0/axios.min.js"></script>
  <script src="/static/layui/layui.js"></script>
  <script>
    function logout() {
      axios({
        method: 'post',
        url: '/logout'
      }).then(function (response) {
        // axios工具下，服务器真正返回的数据在返回对象的data中
        let res = response.data;
        if (res.code === 200) {
          window.location.href = '/';
        }
      }).catch((err) => {

      });
    }
  </script>
  <script type="text/javascript">
    $(function () {
      let navflag = false;
      $('.nav-tab').click(function () {
        $(this).siblings().each(function () {
          $(this).removeClass('a_active');
          // $(this).removeClass('a_active');
          $(this).find('.nav-box').css('height', '0')
          //关闭右侧箭头
          if ($(this).attr('class').indexOf('nav-ul') != -1) {
            $(this).find('.bx-chevron-right').css('transform', 'rotateZ(0deg)')
            $(this).find('.bx-chevron-right').css('transition', 'all .5s')
            $(this).removeClass('nav-show')
            // $(this).find('div').removeClass('nav-box')
          }
        })
        //当前选中
        $(this).addClass('a_active')
        $(this).find('.li-a').addClass('active')
        // 打开右侧箭头
        $(this).find('.bx-chevron-right').css('transform', 'rotateZ(90deg)')
        $(this).find('.bx-chevron-right').css('transition', 'all .5s')
        $(this).addClass('nav-show')
        // $(this).find('div').addClass('nav-box')
      })
      /* 二级菜单a点击事件 */
      $(".li-a-a").click(function () {
        $(".li-a-a").each(function () {
          $(this).removeClass('active-li-a');
        })
        $(this).addClass('active-li-a');
      })
    })
	// const vue = new Vue({
	// 	el:'#app',
	// 	data:{

	// 	},
	// 	methods:{
	// 		liCli(){

	// 		}
	// 	}
	// })
  </script>

</body>

</html>